<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%@ include file="/common/grid/jqGrid.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="">
	<meta http-equiv="description" content="">
	
  </head>
  
  <body>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		
    		<s:hidden id="moduleId" name="lm.id"></s:hidden>
    		
    		<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
    			<tr bgcolor="#FFFFFF">
    				<td width="15%" align="right" class="label">
    					模块编码：
    				</td>
    				<td width="85%" align="left">
    					<s:textfield name="lm.moduleCode" id="moduleCode" cssStyle="width:300px" maxlength="20"></s:textfield>
    				</td>
    			</tr>
    			<tr bgcolor="#FFFFFF">
    				<td align="right" class="label">
    					模块名称：
    				</td>
    				<td align="left">
    					<s:textfield name="lm.moduleName" id="moduleName" cssStyle="width:300px" maxlength="20"></s:textfield>
    				</td>
    			</tr>
    		</table>
    		
    		<table width="100%" cellspacing="0">
    			<tr>
    				<td align="center" valign="bottom" height="30">
    					<input type="button" value="保存" class="btn" onclick="saveListModule()" />
    				</td>
    			</tr>
    		</table>
    	</s:form>
    
    <script type="text/javascript">
    function saveListModule()
    {
        var moduleCode = $('#moduleCode');
        var moduleName = $('#moduleName');
        if(!isNotNull(moduleCode.val()))
        {
			showMsg('模块编码不能为空。', function(){
				moduleCode.focus();
			});
			return;
        }
        if(!isNotNull(moduleName.val()))
        {
			showMsg('模块名称不能为空。', function(){
				moduleName.focus();
			});
			return;
        }
		var url = 'inner/core/saveListModule.action';
		ajaxAction(url, 'post', 'frm', true, function(msg){
			var obj = eval(msg);
			if('success' == obj.result)
			{
				window.opener.searchThis();
				window.close();
			}
			else
			{
				showMsg(obj.message);
			}
		});
    }
    </script>
  </body>
</html>
